home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / satellit / pacdoc / blogdisp.txt < prev    next >
Text File  |  1993-05-25  |  5KB  |  145 lines

  1. Release: 25/5/93
  2.  
  3. BROADCAST LOGS
  4.  
  5. Each day, the PACSAT Broadcast Protocol server (PBP) creates a broadcast log file.
  6. This file is stored with the name BLyymmdd and the file type 202.
  7.  
  8. PBP writes records to the PB file periodically; although the log period is usually
  9. set to 1 hour, it is sometimes reduced to 15 minutes to provide a better look
  10. at broadcast activity. The records tell how many commands PBP has received, what
  11. types of responses it has transmitted, how many bytes of requests have entered
  12. and left the broadcast queue, etc.
  13.  
  14.  
  15. BL RECORD FORMAT
  16.  
  17. The first record in the BL file is a version identifier
  18.  
  19. struct VERSION_ID{
  20.     int Len=2;
  21.     int Version;
  22. }
  23.  
  24. All other entries in the file are log entries with the following structure
  25.  
  26. struct PB_LOG_ENTRY{
  27.     int Len;
  28.     time_t LogTime;
  29.     struct STAT_STRUCT Stats;
  30. }
  31.  
  32. The Len element is the length of the record, including LogTime and Stats, but
  33. excluding Len itself. 
  34.  
  35. The STAT_STRUCT contains the interesting information.
  36.  
  37.  
  38.  
  39. The STAT_STRUCT is defined as:
  40.  
  41. struct STAT_STRUCT {
  42.                     /* Request counters.        */
  43.     long nHolefills;        /* How many hole fill requests    */
  44.     long nStartFile;        /* How many file start requests    */
  45.     long nEndFile;            /* How many file end requests    */
  46.                     /* Error counters.        */
  47.     long nNoFile;            /* Requested file not found.    */
  48.     long nNoRoom;            /* No room in broadcast queue.    */
  49.     long nNotOK;            /* File access denied.        */
  50.                     /* Byte counters.        */
  51.     long nbRequested;        /* Total bytes requested.    */
  52.     long nbOverwrite;        /* Not transmitted (See below)    */
  53.     long nbUnfresh;            /*        "        */            
  54.     long nbPfhErr;            /*        "        */
  55.     long nbFopenErr;        /*        "        */
  56.     long nbEnd;            /*        "        */
  57.     long nbTransmitted;        /* Bytes of data transmitted.    */
  58.  
  59.     long nhRequested;        /* Number of Holes requested.    */
  60.  
  61.     long nDirReqs;            /* Number of directory requests    */
  62.     long nbDirTxd;            /* Bytes of dirs transmitted     */
  63.  
  64.     /* To determine the satellite's data transmission rate, PBP     */
  65.     /* counts the number of 10 mSec "ticks" spent transmitting      */
  66.     /* directories and data. These tick counters can then be used   */
  67.     /* with nbDirTxd and nbTransmitted to determine the satellite's    */
  68.     /* transmission rate.        (Version 2)            */
  69.     long TicksDir;
  70.     long TicksData;            
  71.  
  72.     /* Count of the number of new stations heard during the period    */
  73.     /* "New" stations are those not yet heard today.        */
  74.     /* (Version 2)                            */
  75.     int nNewStations;
  76.  
  77.     /* In some circumstances, stations will request data which is    */
  78.     /* beyond the end of a file. This data is added to nbRequested,    */
  79.     /* and when it is removed from the queue it is added to        */
  80.     /* nbEof. (version 3)                        */
  81.     long nbEof;
  82.     /* Number of permanent broadcast requests received. Version 3    */
  83.     int nLongFile;
  84.  
  85. };
  86.  
  87.  
  88. INPUT AND OUTPUT FROM THE QUEUE
  89.  
  90. It is desirable to know what happens to every broadcast request received.
  91. The counters
  92.  
  93.     long nbRequested;        /* Total bytes requested.    */
  94.     long nbOverwrite;        /* Not transmitted (See below)    */
  95.     long nbUnfresh;            /*        "        */            
  96.     long nbPfhErr;            /*        "        */
  97.     long nbFopenErr;        /*        "        */
  98.     long nbEnd;            /*        "        */
  99.     long nbEof            /*              "               */
  100.     long nbTransmitted;        /* Bytes of data transmitted.    */
  101.  
  102. allow us to do this. Ideally, every byte Requested would end up being Transmitted.
  103. There are six reasons for Requested data not to be Transmitted.
  104.  
  105. Overwrite: The station making the request makes a new request. This deletes all
  106.            data remaining to be transmitted from the old request. Repeated
  107.            requests from stations already in the queue increase this number.
  108. Unfresh:   If the request has been in the queue for 10 minutes, it is deleted.
  109. PfhErr:    If the requested file has a corrupted PFH, the request is deleted.
  110. FopenErr:  If the requested file cannot be opened, the request is deleted.
  111. End:       If the station making the request sends an End command, the previous
  112.            request is deleted.
  113. Eof:       Requested data was past then end of the file.
  114.  
  115. If everything is working smoothly, these counters should tell us where every
  116. requested byte ended up:
  117.  
  118. nbRequested=nbTransmitted+nbOverwrite+nbUnfresh+nbPfhErr+nbFopenErr+nbEnd+nbEof
  119.  
  120. This won't always be true on an hour by hour basis, since some requests or
  121. transmissions will cross over the hourly summary boundaries. But if you follow
  122. the logs for several hours, these differences should even to 0.
  123.  
  124. [On UO-22 logs before 6 March 1992, a bug caused the nbOverwrite value to be
  125.  incorrect, and for these logs no attempt to "balance the books" should be
  126.  made. The nbRequested and nbTransmitted are correct.
  127.  
  128.  In fact, up until the addition of nbEof in May 1993, data requested beyond the
  129.  end of a file was counted into nbRequested and never counted out. This lead
  130.  to significant imbalance.
  131. ]
  132.  
  133.  
  134. BLOGDISP - BROADCAST LOG DISPLAY
  135.  
  136. The program BLOGDISP.EXE can display the BL files in three ways: (-b) byte counters,
  137. (-c) command counters, or (-d) directory counters. The error counters are included
  138. with command counters in option (-c).
  139.  
  140. It can also create a "comma separated value" file suitable for spreadsheet input.
  141.  
  142.  
  143. JWW
  144.  
  145.